//
//  ZGSHomeReusableView.m
//  MapleLeaf
//
//  Created by dllo on 15/11/27.
//  Copyright © 2015年 AntennaBabyTeam. All rights reserved.
//

#import "ZGSHomeReusableView.h"

@implementation ZGSHomeReusableView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        
        self.bgView = [[UIView alloc] init];
        self.bgView.backgroundColor = [UIColor whiteColor];
        [self addSubview:self.bgView];
        
        
        self.grayView = [[UIView alloc] init];
        self.grayView.backgroundColor = [UIColor colorWithRed:0.871f green:0.871f blue:0.871f alpha:1.00f];
        [self addSubview:self.grayView];
  
        
        self.lineView = [[UIView alloc] init];
        self.lineView.backgroundColor = [UIColor colorWithRed:0.871f green:0.871f blue:0.871f alpha:1.00f];
        [self addSubview:self.lineView];
    
        
        self.slView = [[UIView alloc] init];
        self.slView.backgroundColor = [UIColor colorWithRed:0.961f green:0.325f blue:0.173f alpha:0.90f];
        [self.bgView addSubview:self.slView];
        
        self.typeLabel = [[UILabel alloc] init];
        [self.bgView addSubview:self.typeLabel];
        self.typeLabel.font = [UIFont systemFontOfSize:16];
        
        self.button = [UIButton buttonWithType:UIButtonTypeSystem];
        [self.button setTitle:@"全部 〉" forState:UIControlStateNormal];
        self.button.titleLabel.font = [UIFont systemFontOfSize:15];
        [self.bgView addSubview:self.button];
        
    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    self.bgView.frame = CGRectMake(0, 10, self.frame.size.width, self.frame.size.height - 10);
    self.grayView.frame = CGRectMake(0, 0, self.frame.size.width, 6);
    self.lineView.frame = CGRectMake(10, self.frame.size.height, self.frame.size.width - 20, 1);
    self.slView.frame = CGRectMake(10, 2, 5, self.frame.size.height - 14);
    self.typeLabel.frame = CGRectMake(20, 0, 130, self.frame.size.height - 10);
    self.button.frame = CGRectMake(self.frame.size.width - 50, 0, 50, self.frame.size.height - 10);
}


@end
